import request from "@/utils/request"

// 登录时的接口
export function login(data) {
    return request({
        url: `http://127.0.0.1:3009/api/login`,
        method: "post",
        data: data
    })
}
export function getinfo() {
    return request({
        url: `http://127.0.0.1:3009/api/getinfo`,
        method: "get",
    })
}
export function getschoolinfo() {
    return request({
        url: `http://127.0.0.1:3009/api/getschoolinfo?`,
        method: "get",
    })
}
export function getschoolnum(schoolname) {
    return request({
        url: `http://127.0.0.1:3009/api/getschoolnum?schoolname=${schoolname}`,
        method: "get",
    })
}
export function getblocknum(blockname) {
    return request({
        url: `http://127.0.0.1:3009/api/getblocknum?blockname=${blockname}`,
        method: "get",
    })
}
export function setschoolnum(schoolname, number) {
    return request({
        url: `http://127.0.0.1:3009/api/setschoolnum?schoolname=${schoolname}&&admission_num=${number}`,
        method: "get",
    })
}
export function setblocknum(blockname, number) {
    return request({
        url: `http://127.0.0.1:3009/api/setblocknum?blockname=${blockname}&&blocknumber=${number}`,
        method: "get",
    })
}
// 得到总条数
export function gettotalblock() {
    return request({
        url: `http://127.0.0.1:3009/api/gettotalblock`,
        method: "get",
    })
}
// 得到该页的数据，参数是该页数
export function getlistblock(number) {
    return request({
        url: `http://127.0.0.1:3009/api/getlistblock?current=${number}`,
        method: "get",
    })
}
// 根据名字删除某条数据，参数是id
export function deleteblock(id) {
    return request({
        url: `http://127.0.0.1:3009/api/deleteblock?id=${id}`,
        method: "get",
    })
}
// 根据名字查询某条数据，参数是blockname
export function getvalueblock(blockname) {
    return request({
        url: `http://127.0.0.1:3009/api/getvalueblock?blockname=${blockname}`,
        method: "get",
    })
}
// 根据id修改某条数据
export function updateblock(data) {
    return request({
        url: `http://127.0.0.1:3009/api/updateblock`,
        method: "post",
        data: data
    })
}
// 添加数据，参数是相关信息
export function addblock(data) {
    return request({
        url: `http://127.0.0.1:3009/api/addblock`,
        method: "post",
        data: data
    })
}

// 得到总条数
export function gettotaluser() {
    return request({
        url: `http://127.0.0.1:3009/api/gettotaluser`,
        method: "get",
    })
}
// 得到该页的数据，参数是该页数
export function getlistuser(number) {
    return request({
        url: `http://127.0.0.1:3009/api/getlistuser?current=${number}`,
        method: "get",
    })
}
// 根据名字删除某条数据，参数是名字
export function deleteuser(id) {
    return request({
        url: `http://127.0.0.1:3009/api/deleteuser?id=${id}`,
        method: "get",
    })
}
// 根据名字查询某条数据，参数是名字
export function getvalueuser(username) {
    return request({
        url: `http://127.0.0.1:3009/api/getvalueuser?username=${username}`,
        method: "get",
    })
}
// 根据名字修改某条数据
export function updateuser(data) {
    return request({
        url: `http://127.0.0.1:3009/api/updateuser`,
        method: "post",
        data: data
    })
}
// 添加数据，参数是相关信息
export function adduser(data) {
    return request({
        url: `http://127.0.0.1:3009/api/adduser`,
        method: "post",
        data: data
    })
}

// 得到总条数
export function gettotalschool() {
    return request({
        url: `http://127.0.0.1:3009/api/gettotalschool`,
        method: "get",
    })
}
// 得到该页的数据，参数是该页数
export function getlistschool(number) {
    return request({
        url: `http://127.0.0.1:3009/api/getlistschool?current=${number}`,
        method: "get",
    })
}
// 根据名字删除某条数据，参数是名字
export function deleteschool(id) {
    return request({
        url: `http://127.0.0.1:3009/api/deleteschool?id=${id}`,
        method: "get",
    })
}
// 根据名字查询某条数据，参数是名字
export function getvalueschool(schoolname) {
    return request({
        url: `http://127.0.0.1:3009/api/getvalueschool?schoolname=${schoolname}`,
        method: "get",
    })
}
// 根据名字修改某条数据
export function updateschool(data) {
    return request({
        url: `http://127.0.0.1:3009/api/updateschool`,
        method: "post",
        data: data
    })
}
// 添加数据，参数是相关信息
export function addschool(data) {
    return request({
        url: `http://127.0.0.1:3009/api/addschool`,
        method: "post",
        data: data
    })
}